import request from '@/config/axios'
//获取列表
export const getKeywordTaskPage = (params) => {
  return request.getOriginal({
    url: '/amp/keyword-task/page',
    params
  })
}

// 新增任务
export const createKeywordTask = (data) => {
  return request.post({ url: '/amp/keyword-task/create', data: data })
}

// 编辑任务
export const updateKeywordTask = (data) => {
  return request.post({ url: '/amp/keyword-task/update', data: data })
}

// 删除任务
export const deleteKeywordTask = (id: number | string) => {
  return request.delete({ url: '/amp/keyword-task/delete?id=' + id })
}

// 获取任务详情
export const getKeywordTask = (id: number | string) => {
  return request.get({ url: '/amp/keyword-task/get?id=' + id })
}

// 关键词结果分页
export const getKeywordResult = (params) => {
  return request.getOriginal({
    url: '/amp/keyword-result/page',
    params
  })
}

// 删除关键词结果
export const deleteKeywordResult = (id: number | string) => {
  return request.delete({ url: '/amp/keyword-result/delete?id=' + id })
}

// 获得不包含关键字的文档
export const getNoKeywordFile = (params) => {
  return request.get({ url: '/amp/keyword-result/get-no-keyword-file', params })
}

// 同步至特征库
export const syncKeywordTask = (data) => {
  return request.post({ url: '/amp/keyword-result/sync', data: data })
}

// 新增关键词
export const addKeyWord = (data) => {
  return request.postOriginal({ url: '/amp/keyword-result/add', data })
}

//导出关键词
export const exportKeyWord = (params) => {
  return request.download({ url: '/amp/keyword-result/export-file', params })
}
